<gm:page title="Scrum Project Manager" css="/css/g.css" class="googleTheme" 
  authenticate="true">

  <p>This page shows all the data in the application. The model is simple:
  There is a list of projects. Each project has some stories and some sprints.
  Each sprint has some stories that are planned in that sprint.</p>

  <h2>Projects</h2>
  <gm:list id="Projects" data="${app}/Projects" template="projectList"/>

  <h2>Unplanned stories for selected project</h2>
  <gm:list id="ProjectStories" data="${Projects}/Stories" template="storyList">
    <gm:handleEvent src="Projects"/>
  </gm:list>
  
  <h2>Sprints for selected project</h2>
  <gm:list id="Sprints" data="${Projects}/Sprints" template="sprintList">
    <gm:handleEvent src="Projects"/>
  </gm:list>
  
  <h2>Stories for selected sprint</h2>
  <gm:list id="SprintStories" data="${Sprints}/Stories" template="storyList">
    <gm:handleEvent src="Sprints"/>
  </gm:list>
  
  <gm:template id="projectList">
    <table class="gm-table">
      <thead><tr>
        <td width="200">Name</td>
        <td width="100">Product owner</td>
        <td width="100">Scrum master</td>
        <td width="45"></td>
      </tr></thead>
      <tr repeat="true">
        <td><gm:text ref="atom:title" hint="Project name"/></td>
        <td><gm:text ref="gmd:productOwner"/></td>
        <td><gm:text ref="gmd:scrumMaster"/></td>
        <td><gm:editButtons/></td>
      </tr>
      <tfoot><tr><td colspan="4" align="right">
        <gm:create label="New project"/>
      </td></tr></tfoot>
    </table>
  </gm:template>
  
  <gm:template id="storyList">
    <table class="gm-table">
      <thead><tr>
        <td width="200">Title</td>
        <td width="75">Type</td>
        <td width="25">Estimate</td>
        <td width="100">How to demo</td>
        <td width="45"></td>
      </tr></thead>
      <tr repeat="true">
        <td><gm:text ref="atom:title" hint="Story title"/></td>
        <td><gm:select ref="gmd:storyType">
          <gm:option value="user" selected="true">User</gm:option>
          <gm:option value="tech">Tech</gm:option>
        </gm:select></td>
        <td><gm:number ref="gmd:estimate"/></td>
        <td><gm:text ref="gmd:howToDemo"/></td>
        <td><gm:editButtons/></td>
      </tr>
      <tfoot><tr><td colspan="5" align="right">
        <gm:create label="New story">
      </td></tr></tfoot>
    </table>
  </gm:template>

  <gm:template id="sprintList">
    <table class="gm-table">
      <thead><tr>
        <td width="100">Name</td>
        <td width="100">Start date</td>
        <td width="100">End date</td>
        <td width="100">Goal</td>
        <td width="45"></td>
      </tr></thead>
      <tr repeat="true">
        <td><gm:text ref="atom:title" hint="Sprint name"/></td>
        <td><gm:date ref="gd:when/@startTime"/></td>
        <td><gm:date ref="gd:when/@endTime"/></td>
        <td><gm:text ref="gmd:goal"/></td>
        <td><gm:editButtons/></td>
      </tr>
      <tfoot><tr><td colspan="4" align="right">
        <gm:create label="New sprint"/>
      </td></tr></tfoot>
    </table>
  </gm:template>
    
</gm:page>
